import React, { useState } from 'react';
import {Button, Input, Modal, Segmented} from 'antd';
import FormD from './form'
import TableT from './table'
import Table2 from './table2'
import Table3 from './table3'


const App = (props) => {
    const [isModalOpen, setIsModalOpen] = useState(false);
    const [SegmentedText, setSegmentedText] = useState('批量审核');

    const showModal = () => {
        setIsModalOpen(true);
    };

    const handleOk = () => {
        setIsModalOpen(false);
    };

    const handleCancel = () => {
        setIsModalOpen(false);
    };

    React.useImperativeHandle(props.onRef, () => {
        return {
            showModal: showModal,
        };
    });
    return (
        <>
            <Modal title="批量任务" width={1000} open={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
                <div>
                    <FormD />
                </div>
                <div>
                    <Segmented<string>
                        options={['批量审核', '批量打印', '批量作废']}
                        onChange={(value) => {
                            setSegmentedText(value)
                        }}
                    />
                </div>
                <div>
                    {SegmentedText === '批量审核' ? <TableT /> : null}
                    {SegmentedText === '批量打印' ? <Table2 /> : null}
                    {SegmentedText === '批量作废' ? <Table3 /> : null}
                </div>
                <div>
                    审核医生：久正工程师

                    <span style={{marginLeft: '18px'}}>实验号：<Input style={{width: '100px'}} defaultValue="001" placeholder="请输入" /></span>
                </div>
            </Modal>
        </>
    );
};

export default App;
